home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Environments / Oberon⁄F™ 1.2 / Preinstalled version / Form / Docu / Controllers (.txt) < prev    next >
Encoding:
Oberon Document  |  1996-07-08  |  5.0 KB  |  117 lines  |  [oODC/obnF]

  1. Documents.StdDocumentDesc
  2. Documents.DocumentDesc
  3. Containers.ViewDesc
  4. Views.ViewDesc
  5. Stores.StoreDesc
  6. Documents.ModelDesc
  7. Containers.ModelDesc
  8. Models.ModelDesc
  9. Stores.ElemDesc
  10. TextViews.StdViewDesc
  11. TextViews.ViewDesc
  12. TextModels.StdModelDesc
  13. TextModels.ModelDesc
  14. TextModels.AttributesDesc
  15. Helvetica
  16. TextRulers.StdRulerDesc
  17. TextRulers.RulerDesc
  18. TextRulers.StdStyleDesc
  19. TextRulers.StyleDesc
  20. TextRulers.AttributesDesc
  21. Helvetica
  22. Helvetica
  23. Helvetica
  24. Helvetica
  25. Helvetica
  26. FormControllers
  27. DEFINITION FormControllers;
  28.     IMPORT Views, Controllers, Containers, FormModels, FormViews;
  29.     CONST noSelection = Containers.noSelection; noFocus = Containers.noFocus;
  30.     TYPE
  31.         Controller = POINTER TO ControllerDesc;
  32.         ControllerDesc = RECORD (Containers.ControllerDesc)
  33.             form-: FormModels.Model;
  34.             view-: FormViews.View;
  35.             PROCEDURE (c: Controller) ThisView (): FormViews.View;
  36.             PROCEDURE (c: Controller) Select (view: Views.View);
  37.             PROCEDURE (c: Controller) Deselect (view: Views.View);
  38.             PROCEDURE (c: Controller) IsSelected (view: Views.View): BOOLEAN;
  39.             PROCEDURE (c: Controller) GetSelection (): List;
  40.             PROCEDURE (c: Controller) SetSelection (l: List)
  41.         END;
  42.         Directory = POINTER TO DirectoryDesc;
  43.         DirectoryDesc = RECORD (Controllers.DirectoryDesc)
  44.             PROCEDURE (d: Directory) NewView (f: FormModels.Model; opts: SET): FormViews.View
  45.         END;
  46.         List = POINTER TO ListDesc;
  47.         ListDesc = RECORD
  48.             next: List;
  49.             view: Views.View
  50.         END;
  51.     VAR dir-, stdDir-: Directory;
  52.     PROCEDURE Focus (): Controller;
  53.     PROCEDURE Insert (c: Controller; view: Views.View; l, t, r, b: LONGINT);
  54.     PROCEDURE SetDir (d: Directory);
  55.     PROCEDURE Install;
  56. END FormControllers.
  57. FormControllers are standard controllers for FormViews. Note that forms can only be used in a non-modal way, i.e. a program doesn't wait until the user is finished with the form. In other words: the user is in control, not the computer.
  58. TYPE Controller
  59. Interface, Extension
  60. Standard controllers for form views.
  61. form-: FormModels.Model    form # NIL
  62. The controller's model.
  63. view-: FormViews.View    view # NIL & view.ThisModel() = form
  64. The controller's view.
  65. PROCEDURE (c: Controller) Select (view: Views.View)
  66. Interface
  67. Adds a view to the current selection, if it isn't selected already.
  68. view in c.form    20
  69. ~(noSel IN c.opts)    21
  70. c.IsSelected(view)
  71. c.ThisFocus() = NIL
  72. PROCEDURE (c: Controller) Deselect (view: Views.View)
  73. Interface
  74. Removes a view from the current selection, if it is selected.
  75. view in c.form    20
  76. ~c.IsSelected(view)
  77. PROCEDURE (c: Controller) IsSelected (view: Views.View): BOOLEAN
  78. Interface
  79. Determines whether the given view is currently selected or not. NIL is not considered selected.
  80. view = NIL  OR  view in c.form    20
  81. PROCEDURE (c: Controller) GetSelection (): List
  82. Interface
  83. Returns the list of selected subviews.
  84. all views of the result list are in c.form
  85. PROCEDURE (c: Controller) SetSelection (l: List)
  86. Interface
  87. Removes the existing selection, and selects the subviews of l.
  88. all views of l are in c.form    20
  89. TYPE Directory
  90. Interface, Extension
  91. Directory for form view controllers.
  92. PROCEDURE (d: Directory) NewView (m: FormModels.Model; opts: SET): FormViews.View
  93. Interface
  94. Create a new form view with a new controller for form m, and return the view.
  95. result # NIL    
  96. result.ThisModel() = m
  97. result.ThisController() # NIL
  98. result.ThisController().opts = opts
  99. VAR dir-, stdDir-: Directory
  100. Controller directories.
  101. PROCEDURE Focus (): Controller
  102. Returns the focus controller, if the focus currently is a form view, otherwise it returns NIL.
  103. PROCEDURE Insert (c: Controller; view: Views.View; l, t, r, b: LONGINT)
  104. Inserts view into c's view at the position (l, t, r, b). If necessary, the position is slightly corrected (rounded) such that view's top-left corner comes to lie on the grid. The size of view is not changed, however.
  105. PROCEDURE SetDir (d: Directory)
  106. Set directory d.
  107. d # NIL    20
  108. dir = d
  109. PROCEDURE Install
  110. Used internally.
  111. TextControllers.StdCtrlDesc
  112. TextControllers.ControllerDesc
  113. Containers.ControllerDesc
  114. Controllers.ControllerDesc
  115. Helvetica
  116. Documents.ControllerDesc
  117.